﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace SimplexEngine
{
    public class ViewArea
    {
        public ViewArea() 
        {
            ViewPort = Root.Instance.RenderSystem.DefaultViewPort;
        }

        public virtual Boolean CanDraw
        {
            get 
            {
                return camera != null && camera.CanDraw;
            }
        }

        public virtual Camera Camera 
        {
            get { return camera; }
            set
            {
                camera = value;
                if (camera != null)
                    camera.ViewAreaChanged(this);
            }
        }
        
        public virtual Viewport ViewPort 
        {
            get { return view_port; } 
            set 
            {
                view_port = value;
                // reset camera to apply view port
                Camera = camera;
            } 
        }

        protected Viewport view_port;
        protected Camera camera;

    }
}
